﻿using System;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using Water.Web.Controls.BaseInterface;
using System.Web.UI.Design;
using System.Drawing.Design;
using System.Collections;
using System.Drawing;

[assembly: WebResource("Water.Resources.Default.JS.Base.ui.core.js", "text/javascript")]
[assembly: WebResource("Water.Resources.Default.JS.Base.ui.mouse.js", "text/javascript")]
[assembly: WebResource("Water.Resources.Default.JS.Base.ui.draggable.js", "text/javascript")]
[assembly: WebResource("Water.Resources.Default.JS.Base.jquery.easing.js", "text/javascript")]
[assembly: WebResource("Water.Resources.Default.JS.Dialog.Dialog.js", "text/javascript")]
namespace Water.Web.Controls
{
    [ToolboxData("<{0}:Dialog runat=server></{0}:Dialog>")]
    public partial class Dialog :Container
    {
        protected override void OnLoad(EventArgs e)
        {
            this.RenderPackager += new PreRenderPackager(preRenderPackager);
            this.CssStyleTitle = "dialog";
            base.OnLoad(e);
            this.Page.ClientScript.RegisterClientScriptResource(typeof(PageManager), "Water.Resources.Default.JS.Base.ui.core.js");
            this.Page.ClientScript.RegisterClientScriptResource(typeof(PageManager), "Water.Resources.Default.JS.Base.ui.mouse.js");
            this.Page.ClientScript.RegisterClientScriptResource(typeof(PageManager), "Water.Resources.Default.JS.Base.ui.draggable.js");
            this.Page.ClientScript.RegisterClientScriptResource(typeof(PageManager), "Water.Resources.Default.JS.Base.jquery.easing.js");
            this.Page.ClientScript.RegisterClientScriptResource(typeof(Dialog), "Water.Resources.Default.JS.Dialog.Dialog.js");
        }

        private void preRenderPackager(HtmlTextWriter write)
        {
            write.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
        }

        protected override void RenderzoomImg(HtmlTextWriter writer)
        {
            //base.RenderzoomImg(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "dialog-close dialog-tool dialog-tool-close");
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_close");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.RenderEndTag();

        }

        protected override void RenderSrc(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Src);
        }
    }
}
